package LopCoBan;
import java.util.ArrayList; 

public class NhaCungCap {

	//Các thuộc tính
    private String MaNCC;
    private String TenNCC;
    private String Diachi;
    private String SoDT;
    private String Email;
    private ArrayList<HDNhap> mHDNhap;

    //Các phương thức
    public NhaCungCap () {
    }
    public NhaCungCap (String ma, String ten, String dc,String sdt, String email) {
    	MaNCC = ma;
    	TenNCC = ten;
    	Diachi = dc;
    	Email=email;
    	SoDT=sdt;
    	
    }

    public String getDiachi () {
        return Diachi;
    }

    public void setDiachi (String val) {
        this.Diachi = val;
    }

    public String getEmail () {
        return Email;
    }

    public void setEmail (String val) {
        this.Email = val;
    }

    public String getMaNCC () {
        return MaNCC;
    }

    public void setMaNCC (String val) {
        this.MaNCC = val;
    }

    public String getSoDT () {
        return SoDT;
    }

    public void setSoDT (String val) {
        this.SoDT = val;
    }

    public String getTenNCC () {
        return TenNCC;
    }

    public void setTenNCC (String val) {
        this.TenNCC = val;
    }

    public ArrayList<HDNhap> getHDNhap () {
        return mHDNhap;
    }
    
    public boolean addHDNhap(HDNhap val)
    {
    	for(HDNhap hd : mHDNhap)
    	{
    		if(val.equals(hd))
    			return false;
    	}
    	return true;
    }
    
    public void setHDNhap (ArrayList<HDNhap> val) {
        this.mHDNhap = val;
    }
    
    public int TongTien()
    {
    	int sum = 0;
    	for(HDNhap hd : mHDNhap)
    	{
    		sum += hd.TinhTien();
    	}
    	return sum;
    }
}

